package hichecker.tools.export;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

import org.apache.log4j.Logger;

public class CSVWriter {
	private static Logger logger = Logger.getLogger(CSVWriter.class);

	public static void writeToFile(CSVFile file, String path) {
		String fullFilePath = path + file.getName() + ".csv";

		try {
			BufferedWriter out = new BufferedWriter(new FileWriter(fullFilePath));
			out.write(file.toString());
			out.close();
		} catch (IOException e) {
			logger.error("unable to create file: " + fullFilePath);
		}
	}
}
